package com.zx.mq.pubsub;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PubSubController {

    @Autowired
    PubSubSender pubSubSender;

    @GetMapping("/pubsub/{num}")
    public String hello(@PathVariable int num){
        for(int i=0;i<num;i++){
            pubSubSender.send("data: "+i);
        }

        return "ok";
    }
}
